<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>cookie</title>
<script type="text/javascript">
	var CookieTool = function() {
	};

	CookieTool.prototype = {
		setCookie : function(c_name, value, expiredays) {
			var exdate = new Date();
			exdate.setDate(exdate.getDate() + expiredays);
			document.cookie = c_name
					+ "="
					+ escape(value)
					+ ((expiredays == null) ? "" : "; expires="
							+ exdate.toUTCString());
			return this;
		},
		getCookie : function(c_name) {
			if (document.cookie.length > 0) {
				var c_start = document.cookie.indexOf(c_name + "=")
				if (c_start != -1) {
					c_start = c_start + c_name.length + 1
					var c_end = document.cookie.indexOf(";", c_start)
					if (c_end == -1) {
						c_end = document.cookie.length
					}
					return unescape(document.cookie.substring(c_start, c_end))
				}
			}
			return "";
		}
	}

	/* 	var a = new CookieTool();
	 a.setCookie("pwd","123456",1);
	 console.log(a.getCookie("username")+"==="+a.getCookie("pwd")); */

	function getTBprefixName(str, sta) {
		if (str.indexOf("active") != -1 || str.indexOf("normal") != -1) {
			str = str.substr(6);
		} else if (str.indexOf("over") != -1) {
			str = str.substr(4);
		} else {
			str = "";
		}
		return sta + str;
	}

	function startajaxtabs() {
		console.log("arguments.length="+arguments.length);
		for (var i = 0; i < arguments.length; i++) {
			var ulobj = document.getElementById(arguments[i]);
			var ulist = ulobj.getElementsByTagName("li");
			for (var j = 0; j < ulist.length; j++) {
				var thelist = ulist[j];
				if (thelist.parentNode.parentNode != ulobj) {
					continue;// 只有第一层li有效 fixed 2006.9.29
				}
				var ulistlink = thelist.getElementsByTagName("a")[0];
				var ulistlinkurl = ulistlink.getAttribute("urn");
				var ulistlinktarget = ulistlink.getAttribute("rel");
				thelist.setActive = function(bactive) {
					if (bactive) {
						this.status = "active";
						this.className = getTBprefixName(this.className,
								"active");
					} else {
						this.status = "normal";
						this.className = getTBprefixName(this.className,
								"normal");
					}
				}
			}
			if (ulobj.activetab == null) {
				ulobj.activetab = ulist[0];
			}
		}
	}
</script>
</head>
<body>

	<div class="jsmenu" id="jsmenu">
		<ul>
			<li class="active"><a href="index.jsp" urn="#default_Info"
				rel="conmenu">首页</a></li>
			<li class="normal"><a urn="jsmenu1" rel="conmenu"
				href="GetMessageList">消息列表</a></li>
			<li class="normal"><a urn="jsmenu2" rel="conmenu"
				href="publishNewMsg.jsp">发布新消息</a></li>
			<li class="normal"><a urn="jsmenu3" rel="conmenu"
				href="statusRecognise.jsp">身份识别</a></li>
		</ul>
	</div>


</body>
</html>